#include "progress.h"


void processOn()
{
    char buf[N] = {0};
    int cnt = 0;
    char roll[4] = {'|', '/', '-', '\\'};
    while (cnt <= 100)
    {
        printf("[%-100s][%d%%][%c]\r", buf, cnt, roll[cnt % 4]);
        fflush(stdout);
        //计划5s打印完进度条 5s/100 = 0.05s即每轮循环大约休眠0.05s
        //0.05*100w = 50000
        usleep(50000);
        buf[cnt++] = STYLE;
    }
    printf("\n");
}
